﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
	x:Class="NtpChat.Client.ConversationView"
	x:Name="Window"
	Title="ConversationView"
	UseLayoutRounding="True"
	Width="361" Height="480" Closing="Window_Closing"
	xmlns:v="clr-namespace:NtpChat.Client">

	<DockPanel x:Name="LayoutRoot">
		<ListBox ItemsSource="{Binding Messages}" DockPanel.Dock="Top" MinHeight="350" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" Height="340">
			<ListBox.ItemTemplate>
				<DataTemplate>
					<v:MessageView></v:MessageView>
				</DataTemplate>
			</ListBox.ItemTemplate>
		</ListBox>
		<StackPanel Margin="0" Orientation="Vertical" Width="345" d:LayoutOverrides="Height" VerticalAlignment="Bottom">
			<TextBox x:Name="messageText" TextWrapping="Wrap" Text="{Binding MessageText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="50" Margin="0">
				<TextBox.InputBindings>
					<KeyBinding Key="Return" Command="{Binding SendMessageCommand}" CommandParameter="{Binding ElementName=messageText,Path=Text}" ></KeyBinding>
				</TextBox.InputBindings>
			</TextBox>
			<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,5,5">
				<Button Content="Send" Margin="0,0,5,0" Command="{Binding SendMessageCommand}" CommandParameter="{Binding ElementName=messageText,Path=Text}"/>
				<Button Content="Call"/>
			</StackPanel>
		</StackPanel>
	</DockPanel>
</Window>